package com.aclass.xqx.classscreen.db;

/**
 * Created by xqx on 2017/11/23.
 * 添加数据类
 */

public class AddData {
     private static StudentNews studentNews=new StudentNews();//添加消息
     private static CardTeacher teacher=new CardTeacher();//添加老师
     private static Cardnumber cardnumber=new Cardnumber();//添加卡号
     private static  CardStudent cardStudent=new CardStudent();//添加学生
     private static  ClassSchedule schedule=new ClassSchedule();//添加课表
     private static    ClassAlbum classAlbum=new ClassAlbum();//添加相册
     private static    ClassLabour classLabour=new ClassLabour();//添加相册

    /**
     * @param id 消息id
     * @param message 消息内容
     * @param card_no 消息卡号
     * @param add_time 消息时间
     */
    public static void addStudentNews(String id,String message,String card_no,String add_time){
        studentNews.setId(id);
        studentNews.setNewsContent(message);
        studentNews.setN_id(card_no);
        studentNews.setNewsTime(add_time);
        CardDao.insertNews(studentNews);
    }

    /**
     * @param card_no 老师卡号
     * @param id 老师唯一值
     * @param classname 班级名称
     * @param teacher_name 老师名称
     */
    public static void addTeacher(String id, String card_no,String classname,String teacher_name){
        cardnumber.setCardnumber(card_no);
        cardnumber.setId(id);
        cardnumber.setType(2);
        teacher.setId(id);
        teacher.setClassname(classname);
        teacher.setCard_no(card_no);
        teacher.setTeacher_name(teacher_name);
        CardDao.insertCard(cardnumber);
        CardDao.insertTeacher(teacher);
    }

    /**
     * @param card_no 学生卡号
     * @param id 学生唯一值
     * @param name 学生姓名
     * @param honor_id 学习进步之星
     * @param headimg 头像
     */
    public static void addStudent(String id,String card_no,String name,String honor_id,String headimg){
        cardnumber.setCardnumber(card_no);
        cardnumber.setType(1);
        cardnumber.setId(id);
        cardStudent.setId(id);
        cardStudent.setStudent_name(name);
        cardStudent.setStudent_url(headimg);
        cardStudent.setCard_no(card_no);
        cardStudent.setHonor_id(Integer.parseInt(honor_id));
        CardDao.insertCard(cardnumber);
        CardDao.insertStuden(cardStudent);
    }

    /**
     * @param id 课表id
     * @param name 课程名称
     * @param week_day 表示周几
     * @param start_time 课程开始时间
     * @param end_time 课程结束时间
     */
    public static void addSchedule(String id,String name,String week_day,String start_time,String end_time){
        schedule.setId(id);
        schedule.setSubject_name(name);
        schedule.setWeek_day(week_day);
        schedule.setStart_time(start_time);
        schedule.setEnd_time(end_time);
        CardDao.insertSchedule(schedule);
    }

    /**
     *
     * @param id 动态id
     * @param add_time 更新时间
     * @param content 内容
     * @param title 标题
     */
    public static void addDynamic(String id, String add_time,String content,String title){
        Dynamic dynamic=new Dynamic();
        dynamic.setId(id);
        dynamic.setAdd_time(add_time);
        dynamic.setContent(content);
        dynamic.setTitle(title);
        CardDao.insertDynamic(dynamic);
    }

    /**
     *
     * @param id 动态id
     * @param add_time 更新时间
     * @param content 内容
     * @param title 标题
     */
    public static void addDynamicSchool(String id, String add_time,String content,String title){
        DynamicSchool dynamic=new DynamicSchool();
        dynamic.setId(id);
        dynamic.setAdd_time(add_time);
        dynamic.setContent(content);
        dynamic.setTitle(title);
        CardDao.insertDynamicScool(dynamic);
    }

    /**
     * @param id 相册id
     * @param add_time 更新时间
     * @param pic_path 图片路径
     * @param type_id 区分
     */
    public static void addAlbum(String id,String add_time,String pic_path,String type_id){
        classAlbum.setId(id);
        classAlbum.setAddtime(add_time);
        classAlbum.setPic(pic_path);
        classAlbum.setTypeid(type_id);
        CardDao.insertAlbum(classAlbum);
    }

    /**
     * @param id id
     * @param weekday 星期
     * @param studentname 学生名字
     * @param addtime 更新时间
     */
    public static void addLabour(String id,String weekday,String studentname,String addtime){
        classLabour.setId(id);
        classLabour.setWeekday(weekday);
        classLabour.setStudentneme(studentname);
        classLabour.setAddtime(addtime);
        classLabour.setAddtime(addtime);
        CardDao.insertLabour(classLabour);
    }
    public static void addCardNum(String id,String card,int type){
        cardnumber.setId(id);
        cardnumber.setCardnumber(card);
        cardnumber.setType(type);
        CardDao.insertCard(cardnumber);
    }
}
